Skip to content

Remove interpolation function annotation checking and refactor - #2077

Merged
VeckoTheGecko merged 7 commits into
v4-devfrom
interpolation-cleanup
Jul 9, 2025
Merged

Remove interpolation function annotation checking and refactor #2077
VeckoTheGecko merged 7 commits into
v4-devfrom
interpolation-cleanup

Conversation

@VeckoTheGecko

Copy link
Copy Markdown
Contributor

@VeckoTheGecko VeckoTheGecko changed the title Interpolation cleanup Remove interpolation function annotation checking and refactor Jul 9, 2025

@erikvansebille erikvansebille left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@VeckoTheGecko
VeckoTheGecko merged commit 8e5e3da into v4-dev Jul 9, 2025
8 of 9 checks passed
@VeckoTheGecko
VeckoTheGecko deleted the interpolation-cleanup branch July 9, 2025 15:39
@github-project-automation github-project-automation Bot moved this from Backlog to Done in Parcels development Jul 9, 2025
Comment thread parcels/field.py
@vector_interp_method.setter
def vector_interp_method(self, method: Callable):
self._validate_vector_interp_function(method)
_assert_same_function_signature(method, ref=ZeroInterpolator)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A Vector interpolation method needs to be able to accept a VectorField in the first argument. The ZeroInterpolator expects a Field currently. I don't think this will work here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_assert_same_function_signature doesn't check the typing anymore during runtime due to #2076 . I don't think there is a way to reliably do this in Python - since type annotations were bolted on after the fact

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants